package com.qf.day11;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Date01 {
    public static void main(String[] args) throws ParseException {
        Date date1 = new Date();
        long time1= date1.getTime();
        String time2 = "2001-11-14 12:06:09";
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date2 = dateFormat.parse(time2);
        long time = date1.getTime() - date2.getTime();
        long live = time/1000/60/60/24/365;
        System.out.println(time);
        System.out.println(live);
    }

}
